package com.example.springboot_rabbitmq.direct;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class MessageServiceRabbitmqDirectImpl{
    @Resource
    private AmqpTemplate amqpTemplate;

    public void sendMessage(String id) {
        System.out.println("待发送短信的订单已纳入处理队列（rabbitmq direct），id："+id);
        amqpTemplate.convertAndSend("directExchange","direct",id);
        amqpTemplate.convertAndSend("directExchange","direct2",id);
    }
}
